// 封装权限接口
import request from '@/utils/request'

// 获取权限列表
export function getperm(params) {
  return request({
    url: '/permissions',
    method: 'get',
    params
  })
}

// 获取权限数量
export function getcount() {
  return request({
    url: '/permissions/count'
  })
}

// 获取指定权限
export function perId(id) {
  return request({
    url: `/permissions/${id}`
  })
}

//删除权限
export function delper(id){
   return request({
      url: `/permissions/${id}`,
      method:'delete'
   })
}

//新建权限
export function addper(data){
  return request({
     url:'/permissions',
     method:'post'
     ,data
  })
}

//编辑权限
export function ditper(data){
  return request({
    url:`/permissions/${data.id}`,
    method:'put',
    data
  })
}